-
-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Setup SQLite tests #477
Setup SQLite tests #477
Conversation
Thank you for this! I merged main into your branch, which splits the coverage report from the test matrix for the Elixir and OTP versions. I wonder whether it makes sense to run tests for all adapters in the version matrix or whether it would make more sense to only use the Postgres adapter in the version matrix, and test the other adapters on the latest Elixir/OTP version only. It would also be nice to have separate CI jobs for each adapter, so that you can see where it goes wrong more easily. There are different approaches we could take:
Or:
Or:
For ergonomics, it would also be nice to be able to just type |
Thanks for looking into this! I don't have much experience with GH actions, so ultimately your call. Personally, I like the last option with explicit
I added both Let me know if there is anything pending from my side for this PR! |
Thanks, I'll do the rest (don't know when yet, but it's on my list). |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #477 +/- ##
=======================================
Coverage 87.67% 87.67%
=======================================
Files 15 15
Lines 933 933
=======================================
Hits 818 818
Misses 115 115 ☔ View full report in Codecov by Sentry. |
I pushed a couple of changes and disabled the sqlite tests on the CI until they are fixed. Thanks again! |
Context: #446 (comment)
This PR changes test setup so that it could run against multiple databases. I copied the
ecto_sql
approach here. A quick summary:test
andintegration_test
folders. The former can run on their own, the latter require a db.mix test
only runs tests intest
foldermix test.all
runsmix test
withECTO_ADAPTER={adapter name}
for each adapter defined in@adapters
attribute inmix.exs
. Depending on the env variable,mix test
runs tests inintegration_test/{adapter name}
. Each folder containstest_helper.exs
which runs adapter-specific setup (start repo and run migrations). Each folder also containsall_test.exs
file which imports adapter-agnostic test cases fromintegration_test/cases/
. All adapter-specific tests can be put directly in adapter folder, i.e.integration_test/pg/prefix_test.exs
priv/migrations
so that they could be run indev
environment.My goal here was to make tests possible, so I didn't look into fixing failing ones.
I hope this helps!